//机构管理模块
import request from "@/utlis/request";
import type { IDeptResponseData, IDeleteResponseData } from "@/api/acl/type";

enum API {
  DEPTFINDTREE_URL = "/dept/findTree", //查询所有机构
  DEPTSAVE_URL = "/dept/save", //编辑
  DEPTDELETE_URL = "/dept/delete", //删除
}

export const reqDeptFindTree = async () => {
  return request.get<any, IDeptResponseData>(API.DEPTFINDTREE_URL);
};

export const reqDeptSave = async (data: any) => {
  return request.post<any, IDeptResponseData>(API.DEPTSAVE_URL, data);
};

export const reqDeptDelete = async (data: any) => {
  return request.post<any, IDeleteResponseData>(API.DEPTDELETE_URL, data);
};
